<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="/views/common/header.jsp" %>

<section class="invoice">
  <!-- title row -->
  <div class="row">
    <div class="col-xs-12">
      <h2 class="page-header">
        <i class="fa fa-globe"></i> ${res.title }
        <small class="pull-right"> By <b>${user.username}</b> at <b>${res_time }</b></small>
      </h2>
    </div><!-- /.col -->
  </div>
  <!-- info row -->
  <div class="row invoice-info">
    <p>
        ${res.description }
    </p>
  </div><!-- /.row -->

  <!-- this row will not appear when printing -->
  <div class="row no-print">
    <div class="col-xs-12">
      <c:choose>
      <c:when test="${res.downtype == 1 && is_login == 0 }">
      <a class="btn btn-success pull-right" href="/user/Login"><i class="fa fa-lock"></i> 登录</a>
      </c:when>
      <c:otherwise>
      <a  class="btn btn-success pull-right" href="/resource/resDownload/${res.id }"><i class="fa fa-cloud-download"></i> 下载</a>
      </c:otherwise>
      </c:choose>
      
    </div>
  </div>
</section>

<%@ include file="/views/common/footer.jsp" %>